// const SyncHook = require('./SyncHook.js')
// const { SyncHook } = require('tapable')
const AsyncParallelHook = require('./AsyncParallelHook.js')
// const { AsyncParallelHook } = require('tapable')

// let hook = new SyncHook(['name', 'age'])
let hook = new AsyncParallelHook(['name', 'age'])

// hook.tap('fn1', (name, age) => {
//   console.log('fn1-->', name, age)
// })

// hook.tap('fn2', (name, age) => {
//   console.log('fn2-->', name, age)
// })

// hook.call('vue', 18)

hook.tapAsync('fn1', (name, age, callback) => {
  console.log('fn1-->', name, age)
  callback()
})

hook.tapAsync('fn2', (name, age, callback) => {
  console.log('fn2-->', name, age)
  callback()
})

hook.callAsync('zoe', 18, () => {
  console.log('end----')
})
/**
 * 01 实例化 hook， 定义 _x = [f1, f2, ...] taps = [{}, {}]
 * 02 实例调用 tap taps = [{}, {}]
 * 03 调用 call 方法， HookCodeFactory setup create
 * 04 Hook SyncHook HookCodeFactory
 */
